package com.tcy.game.angryrobots.general;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

/**
 * 通用工具类 CommonUtils
 * Created by 80002023 on 2016/7/28.
 */
public class CommonUtils {

    public static void log(String tag, String content) {
        Gdx.app.log(tag, content);
    }

    public static void log(String content) {
        Gdx.app.log("==>", content);
    }

    /**
     * 载入纹理
     *
     * @param file
     * @return
     */
    public static Texture loadTexture(String file) {
        return new Texture(Gdx.files.internal(file));
    }

    /**
     * 载入单张纹理的贴图（未铺满）
     *
     * @param file
     * @return
     */
    public static TextureRegion loadTextureRegion(String file) {
        Texture texture = loadTexture(file);
        return new TextureRegion(texture, 0, 0, texture.getWidth(), texture.getHeight());
    }
}
